<template>
  <div class="home">
    
    <input type="text" v-model="query">
    <button @click="getAnswer">提交</button>

    <hr>

    <div>{{ answer }}</div>

  </div>
</template>

<script>
import answerSwitch from "@/api"
export default {
  name: 'home',
  data() {
    return {
      query:"",
      answer:""

    };
  },
  methods: {
    getAnswer(){
      let param = {
        query : this.query,
        // type: "doc"
        type: "idp"
      }
      let result = answerSwitch(param).answer;
      this.answer = result;
    }


  },

}
</script>
